package com.ttwl.www.app.meFrame.myDown;

import android.graphics.Rect;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;

import com.ttwl.www.app.R;


public class MyDownActivity extends AppCompatActivity {
    private ImageView goBack;
    private RecyclerView downList;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_my_down);
        goBack = (ImageView) findViewById(R.id.go_back);
        goBack.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
        downList = (RecyclerView) findViewById(R.id.down_list);
        downList.setLayoutManager(new LinearLayoutManager((MyDownActivity.this)));
        downList.addItemDecoration(new MyDecoration());
        downList.setAdapter(new LinearAdapterDown(MyDownActivity.this));

    }

    class MyDecoration extends RecyclerView.ItemDecoration {
        @Override
        public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
            super.getItemOffsets(outRect, view, parent, state);
            outRect.set(0,0,0,getResources().getDimensionPixelOffset(R.dimen.dividerHeight));
        }
    }
}
